package com.wn.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Size;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    private Integer id;

    @Size(min = 3,max = 20,message = "用户名长度必须在3-20之间")
    private String name;

    @Size(min = 6,max = 32,message = "密码长度必须在6-32之间")
    private String password;

    public User(Integer id, @Size(min = 3, max = 20, message = "用户名长度必须在3-20之间") String name) {
        this.id = id;
        this.name = name;
    }
}
